package com.yiren.dbaa.module.exam.view.dialog;

import android.app.Activity;
import android.view.WindowManager;

import com.yiren.backstage.currency.entity.LineInfoEntity;
import com.yiren.backstage.currency.entity.ProjectEntity;
import com.yiren.dbaa.currency.model.ScreenModel;
import com.yiren.dbaa.util.GraphicUtil;

import java.util.List;

/**
 * Describe
 *
 * @author WRX
 * @date 2022/7/19
 */
public class ExamSelectDialog {

    /**
     * 获取线路选择的弹框
     */
    public static LineChooseDialog getLineSelectDialog(Activity activity, List<LineInfoEntity> lineInfos, LineInfoEntity lineInfo) {
        LineChooseDialog lineSelectDialog = new LineChooseDialog(activity, lineInfos, lineInfo);
        lineSelectDialog.show();
        WindowManager.LayoutParams params = lineSelectDialog.getWindow().getAttributes();
        ScreenModel screen = GraphicUtil.getResolutionInfo(activity);
        params.width = (screen.getWidth() * 9) / 10;
        params.height = (screen.getHeight() * 5) / 10;
        lineSelectDialog.getWindow().setAttributes(params);
        return lineSelectDialog;
    }

    /**
     * 获取灯光选择的弹框
     */
    public static LightChooseDialog getLightSelectDialog(Activity activity, List<ProjectEntity> lightProjects) {
        LightChooseDialog lightSelectDialog = new LightChooseDialog(activity, lightProjects);
        lightSelectDialog.show();
        // 自动拉伸
        WindowManager.LayoutParams params = lightSelectDialog.getWindow().getAttributes();
        ScreenModel screen = GraphicUtil.getResolutionInfo(activity);
        params.width = (screen.getWidth() * 2) / 3;
        lightSelectDialog.getWindow().setAttributes(params);
        return lightSelectDialog;
    }
}
